<?php

    class itScannerResultTest extends itTestCase {
        
        /**
         * @test
         */
        public function testGeneral() {
            $result = new itScannerResult();
            $result->setClass('ClassA', 'LocationA');
            $result->setClass('ClassB', 'LocationB');
            $result->setInterface('InterfaceA', 'LocationInterfaceA');
            $this->assertEquals('LocationA', $result->getClass('ClassA'));
            $this->assertEquals('LocationB', $result->getClass('ClassB'));
            $this->assertNull($result->getClass('DoesNotExistClass'));
            $this->assertTrue($result->hasClass('ClassA'));
            $this->assertFalse($result->hasClass('DoesNotExistClass'));
            $this->assertEquals('LocationInterfaceA', $result->getInterface('InterfaceA'));
            $this->assertTrue($result->hasInterface('InterfaceA'));
            $this->assertEquals(array(null => array('interfacea' => 'LocationInterfaceA')), $result->getInterfaceArray());
            $this->assertEquals(array(null => array('classa' => 'LocationA', 'classb' => 'LocationB')), $result->getClassArray());
        }
        
        /**
         * @test
         * @depends testGeneral
         */
        public function testNamespaces() {
            $result = new itScannerResult();
            $result->setClass('Namespace\Class', 'Location');
            $this->assertTrue($result->hasClass('Namespace\Class'));
            $this->assertTrue($result->hasClass('NameSpace\ClaSS'));
            $this->assertTrue($result->hasClass(array('namespace', 'Class')));
            $this->assertEquals(array('namespace' => array('class' => 'Location')), $result->getClassArray('Namespace\Class'));
            
            $result->setInterface('Namespace\Interface', 'Location');
            $this->assertTrue($result->hasInterface('Namespace\IntERface'));
            $this->assertTrue($result->hasInterface('NameSpace\InterFAce'));
            $this->assertTrue($result->hasInterface(array('namespace', 'Interface')));
            $this->assertEquals(array('namespace' => array('interface' => 'Location')), $result->getInterfaceArray('Namespace\Interface'));
        
        }
    }
    
?>